<template>
  <swiper :slides-per-view="1" :loop="true" :autoplay="{ delay: 3000 }">
    <swiper-slide v-for="(slide, index) in images" :key="index">
      <img :src="slide" alt="轮播图" />
    </swiper-slide>
  </swiper>
</template>

<script setup>
import { Swiper, SwiperSlide } from 'swiper/vue';
import 'swiper/css';

const props = defineProps({
  images: Array
});
</script>

<style scoped>
.carousel-component img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
</style>